package com.patterns.agent.staticagent;

/**
 * @Author Tanyu
 * @Date 2020/6/2 11:41
 * @Description 代理类需要有真实对象的控制权 (引用)
 * @Version 1.0
 */
public class ProxyManger implements IStar {

  // 真实对象的引用
  private IStar iStar;

  public ProxyManger() {
    super();
  }

  public ProxyManger(IStar iStar) {
    super();
    this.iStar = iStar;
  }

  @Override
  public void sing() {
    System.out.println("唱歌前准备");
    iStar.sing();
   System.out.println("善后工作");
  }

}
